import { FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    component: 'Input',
    label: '角色名称',
    colProps: {
      md: 6,
      sm: 8,
    },
  },
];

export const roleColumns: BasicColumn[] = [
  {
    title: '角色名称',
    align: 'center',
    dataIndex: 'name',
  },
  {
    title: '描述',
    align: 'center',
    dataIndex: 'description',
  },
  {
    title: '用户人数',
    align: 'center',
    dataIndex: 'adminCount',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    align: 'center',
    sorter: true,
  },
];

export const roleFormSchemas: FormSchema[] = [
  {
    field: 'name',
    component: 'Input',
    label: '角色名称',
    required: true,
    rules: [{ min: 2, max: 30, message: '长度在 2 到 30 个字符', trigger: 'blur' }],
  },
  {
    field: 'description',
    component: 'InputTextArea',
    label: '描述',
    rules: [{ min: 0, max: 126, message: '长度不超过 126 个字符', trigger: 'blur' }],
  },
];
